package com.jyy.prefabricated.entity;

import com.fasterxml.jackson.annotation.JsonFormat;
import com.jyy.prefabricated.enums.BaseTeamEnum;
import lombok.Data;
import org.springframework.format.annotation.DateTimeFormat;

import java.io.Serializable;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;

/**
 * 用户
 */
@Data
public class SysUser implements Serializable {

    private static final long serialVersionUID = 1L;

    private Integer id;

    /**
     * 用户名
     */
    private String username;

    /**
     * 密码
     */
    private String password;

    private String channelCode;
    /**
     * 姓名
     */
    private String name;

    /**
     * 身份证号
     */
    private String idCard;

    /**
     * 工号
     */
    private String jobNumber;

    /**
     * 性别
     */
    private Integer sex;

    /**
     * 手机号
     */
    private String mobile;

    /**
     * 邮箱
     */
    private String email;

    /**
     * 微信openid
     */
    private String openid;

    /**
     * 备注
     */
    private String remark;

    /**
     * 状态
     */
    private Integer status;

    /**
     * 租户编码
     */
    private String teamCode = BaseTeamEnum.BASE.getValue();

    /**
     * 用户类型
     */
    private Integer userType;

    /**
     * 用户角色列表
     */
    private List<SysRole> roles;

    /**
     *用户权限列表
     */
    private List<SysPermission> permissions = new ArrayList<>();

    /**
     * 当前用户对应学员
     */
    private Student student;

    /**
     * 当前学员对应机构
     */
    private TrainingOrganization trainingOrganization;

    /**
     * 是否逻辑删除
     */
    private Boolean deleted = false;

    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone = "GMT+8")
    private Date createTime;

    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone = "GMT+8")
    private Date updateTime;

    /**
     * 小鹅通关联userId
     */
    private String userId;

    private String inviter;

    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone = "GMT+8")
    private Date bindingTime;
    private Integer orderNum;
    private Integer customerNum;
    private List<OrderInfo> orderList;
    private List<SysUser> customerList;
}